<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                template="./../template/WorkspaceTemplate.xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:c="http://java.sun.com/jsp/jstl/core">

    <ui:define name="top">

    </ui:define>

    <ui:define name="left">

    </ui:define>

    <ui:define name="right">

    </ui:define>

    <ui:define name="content">
        <h:form>
            <p:panel header="Back Order Detail">
                <h:panelGrid columns="2">
                    <h:outputLabel value="Back Order Id:"/>
                    <h:outputText value="#{backOrderManagerBean.viewedBO.backOrderStrID}"/>

                    <h:outputLabel value="Delivery Order Id:"/>
                    <h:outputText value="#{backOrderManagerBean.viewedBO.deliveryOrder.deliveryOrderIdStr}"/>
                </h:panelGrid>
            </p:panel>

            <p:dataTable var="bo" value="#{backOrderManagerBean.counters}">
                <p:column headerText="Date">
                    <h:outputText value="#{backOrderManagerBean.returnTimestampString(backOrderManagerBean.showedDates.get(bo))}"/>
                </p:column>

                <c:forEach items="#{backOrderManagerBean.counterForProduct}" var="item">
                    <p:column>
                        <f:facet name="header">
                            <h:outputText value="#{backOrderManagerBean.returnProductAlpha(item)}"/>
                        </f:facet>
                        <h:outputText value="#{backOrderManagerBean.showedQty.get(item).get(bo)}"/>
                    </p:column>
                </c:forEach>

            </p:dataTable>
        </h:form>
        <br/>
        <br/>
        <h:form id="legend">
            <p:panel>
                <h:panelGrid columns ="8">
                    <c:forEach items="#{backOrderManagerBean.counterForProduct}" var="item">
                        <h:outputText value="#{backOrderManagerBean.returnProductAlpha(item)}" />
                        <h:outputText value="#{backOrderManagerBean.returnProductName(item)}"/>
                        <h:outputText value=""/>
                        <h:outputText value=""/>
                    </c:forEach>
                </h:panelGrid>
            </p:panel>
        </h:form>
    </ui:define>

    <ui:define name="bottom">

    </ui:define>

</ui:composition>
